//
//  MNDToolIntroduceViewController.m
//  minidai
//
//  Created by Vitas on 2018/7/12.
//  Copyright © 2018年 迷你贷. All rights reserved.
//

#import "MNDToolIntroduceViewController.h"

@interface MNDToolIntroduceViewController ()<UITableViewDelegate,UITableViewDataSource>

//自助投介绍
@property (weak, nonatomic) IBOutlet UILabel *describelLabel;
//项目名称
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
//历史年化
@property (weak, nonatomic) IBOutlet UILabel *yearAprLabel;
//锁定期
@property (weak, nonatomic) IBOutlet UILabel *deadLineLabel;
//最少可投
@property (weak, nonatomic) IBOutlet UILabel *minMoneyLabel;
//投标范围
@property (weak, nonatomic) IBOutlet UILabel *tenderRangeLabel;
//结束时间
@property (weak, nonatomic) IBOutlet UILabel *endTimeLabel;
//计息周期
@property (weak, nonatomic) IBOutlet UILabel *aprCycleLabel;
//费用
@property (weak, nonatomic) IBOutlet UILabel *costLabel;
//到期退出描述
@property (weak, nonatomic) IBOutlet UILabel *exitDescribeLabel;
//利息处理描述
@property (weak, nonatomic) IBOutlet UILabel *aprDescribeLabel;

@end

@implementation MNDToolIntroduceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Do any additional setup after loading the view.
}

#pragma mark - Setter
- (void)setInvestModel:(MNDPlusInvestModel *)investModel {
    _investModel = investModel;
    self.describelLabel.text = investModel.brief;
    self.titleLabel.text = investModel.plan_title;
    self.yearAprLabel.text = [NSString stringWithFormat:@"%@%%",investModel.plan_year_apr];
    self.deadLineLabel.text = [NSString stringWithFormat:@"%zd个月",investModel.plan_deadline];
    self.minMoneyLabel.text = [NSString stringWithFormat:@"%@元",investModel.plan_lowest_money];
    self.tenderRangeLabel.text = investModel.borrow_type;
    self.exitDescribeLabel.text = investModel.out_brief;
    self.
    self.aprCycleLabel.text = investModel.rate_brief;
    self.costLabel.text = [NSString stringWithFormat:@"加入费用：%@  利息管理费用：%@",investModel.fee_add,investModel.fee_manage];
    self.exitDescribeLabel.text = investModel.out_brief;
    self.endTimeLabel.text = investModel.end_date;
    self.aprDescribeLabel.text = investModel.interest_brief;
    [self.tableView reloadData];
}

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset {
    NSLog(@"contentOffset.y = %lf",scrollView.contentOffset.y);
    if (scrollView.contentOffset.y < -60) {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"scroll_up_or_down" object:@0];
    }
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 10;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewAutomaticDimension;
    
}

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 44;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
